# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-gitlab
_pkgname=python-gitlab
pkgver=2.4.0
pkgrel=0
pkgdesc="v4 GitLab API compliant library and cmdline tool"
options="!check" # Requires unpackaged 'httmock'
url="https://github.com/python-gitlab/python-gitlab"
arch="noarch"
license="LGPL-3.0-or-later"
depends="python3 py3-requests py3-six py3-setuptools"
checkdepends="py3-pytest py3-mock py3-responses"
source="https://files.pythonhosted.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# Ignore tests that require unpackaged 'httmock'
	python3 -m pytest \
		--ignore gitlab/tests/test_gitlab.py \
		--ignore gitlab/tests/test_mixins.py \
		--ignore gitlab/tests/objects/test_application.py \
		--ignore gitlab/tests/objects/test_commits.py \
		--ignore gitlab/tests/objects/test_groups.py \
		--ignore gitlab/tests/objects/test_projects.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="9873ce8b3dd50106d3e51cd8a9d2a738d22475813019a239ef8922369451dec75aa2c03b9a9c30d4b41416b4797435c35df30c71bd16f11518340f3ac589f19b  python-gitlab-2.4.0.tar.gz"
